import Home from '@/views/home'
import Search from '@/views/search'
import Mine from '@/views/mine'
import Detail from '@/views/details'
import DetailNav from '@/components/detail-nav'
import Login from '@/views/login'
import Register from '@/views/register'
import Tabbar from '@/components/tabbar'
import Comment from '@/views/comment'
import HotMovie from '@/views/hotmovie'
import DoubanList from '@/views/doubanlist'
import History from '@/views/history'
const routes = [
  {
    path: '*',
    redirect: '/home',
  },
  {
    path: '/home',
    name: 'Home',
    components: {
      default: Home,
      footer: Tabbar,
    },
    meta: {
      title: 'Home',
    },
  },
  {
    path: '/search',
    name: 'Search',
    components: {
      default: Search,
      footer: Tabbar,
    },
    meta: {
      title: 'Search',
    },
  },
  {
    path: '/mine',
    name: 'Mine',
    components: {
      default: Mine,
      footer: Tabbar,
    },
    meta: {
      title: 'Mine',
    },
  },
  {
    path: '/details/:id',
    name: 'Detail',
    components: {
      header: DetailNav,
      default: Detail,
    },
    meta: {
      title: '详情',
    },
  },
  {
    path: '/details/:id/comment',
    name: 'Comment',
    components: {
      header: DetailNav,
      default: Comment,
    },
    meta: {
      title: '全部短评',
    },
  },
  {
    path: '/hot-movie',
    name: 'HotMovie',
    components: {
      header: DetailNav,
      default: HotMovie,
    },
    meta: {
      title: '影院热映',

    },
  },
  {
    path: '/login',
    name: 'Login',
    components: {
      default: Login,
      footer: Tabbar,
    },
    meta: {
      title: 'Login',
    },
  },
  {
    path: '/register',
    name: 'Register',
    components: {
      default: Register,
      footer: Tabbar,
    },
    meta: {
      title: 'Register',
    },
  },
  {
    path: '/doubanlist',
    name: 'DoubanList',
    components: {
      header: DetailNav,
      default: DoubanList,
    },
    meta: {
      title: '豆瓣榜单',
    },
  },
  {
    path: '/history',
    name: 'History',
    components: {
      default: History,
      footer: Tabbar,
    },
    meta: {
      title: 'History',
    },
  },
]

export default routes
